load("//tools:defaults.bzl", "jasmine_node_test", "sass_binary", "ts_library")

package(default_visibility = ["//visibility:public"])

# Test theme used to ensure that our themes will compile using CSS variables in
# the palettes.
sass_binary(
    name = "test-css-variables-theme",
    testonly = True,
    src = "test-css-variables-theme.scss",
    deps = ["//src/material/core:theming_scss_lib"],
)

# Sass binary which is used to ensure that our themes will compile with the legacy and new
# pattern for configuring themes. For more information on the legacy and new pattern, inspect
# the `mat-light-theme` and `mat-dark-theme` theming functions.
sass_binary(
    name = "test-theming-api",
    testonly = True,
    src = "test-theming-api.scss",
    deps = ["//src/material/core:theming_scss_lib"],
)

# Sass binary which is used to ensure that the theming bundle exposes the necessary
# mixins and variables for creating themes.
sass_binary(
    name = "test-theming-bundle",
    testonly = True,
    src = "test-theming-bundle.scss",
    deps = ["//src/material:theming_bundle"],
)

ts_library(
    name = "unit_test_lib",
    testonly = True,
    srcs = [
        "theming-api.spec.ts",
    ],
    deps = [
        "//tools/postcss",
        "@npm//@types/jasmine",
        "@npm//@types/node",
        "@npm//@types/sass",
        "@npm//postcss",
        "@npm//sass",
    ],
)

jasmine_node_test(
    name = "unit_tests",
    srcs = [":unit_test_lib"],
    data = ["//src/material/core:theming_scss_lib"],
    shard_count = 4,
)
